@echo off
::: define lib name
set LIB_NAME=sa_voe_wrapper

::: define the git webrtc lib dir
set GIT_WEBRTC_INC_DIR=..\..\tongxing\webrtc-mirror\src\webrtc\sa_rtc_wrapper\include
set GIT_WEBRTC_LIB_DIR=..\..\tongxing\webrtc-binary\x86\Release

::: define local old file dir
set LOCAL_INC_DIR=.\sa_rtc_wrapper\include
set LOCAL_LIB_DIR=.\sa_rtc_wrapper\lib\x86

::: del local old folder dir
rd /s /q "%LOCAL_INC_DIR%"
rd /s /q "%LOCAL_LIB_DIR%"

::: rebuild local folder
md "%LOCAL_INC_DIR%"
md "%LOCAL_LIB_DIR%"

::: copy new lib
xcopy %GIT_WEBRTC_INC_DIR% %LOCAL_INC_DIR% /e
copy %GIT_WEBRTC_LIB_DIR%\%LIB_NAME%.* %LOCAL_LIB_DIR%

::: copy to Debug and Release
copy %LOCAL_LIB_DIR%\%LIB_NAME%.dll .\Debug
copy %LOCAL_LIB_DIR%\%LIB_NAME%.dll .\Release

pause